package com.black.security.controller;

import com.black.security.entity.User;
import com.black.security.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: Young
 * @CreateTime: 2025-08-13
 * @Description: 用户控制器
 * @Version: 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/userList")
    public List<User> userList() {
        return userService.list();
    }

    @PostMapping("/add")
    public boolean add(@RequestBody User user) {
        return userService.saveUser(user);
    }
}
